<template>
  <div class="block text-center">
    <el-carousel height="40vh" interval="5000">
      <el-carousel-item v-for="item in state.content" :key="item">
        <el-image style="width: 100%; height: 100%" :src="item" fit="fill"/>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script setup>
import {reactive} from 'vue'

const state = reactive({
  content: ['/img/大豆.jpg',
    '/img/棉花.png',
    '/img/玉米.jpg',
    '/img/草莓.jpg',
    '/img/豌豆.png']
})
</script>
<style scoped>
.demonstration {
  color: var(--el-text-color-secondary);
}

.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>
